package org.doc.core.formater.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.doc.bean.Api;
import org.doc.core.config.DocConfig;
import org.doc.core.constant.Constant;
import org.doc.core.formater.Formater;
import org.doc.core.template.FreemarketTemplate;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;

public class HtmlFormater implements Formater{

    @Override
    public void output(List<Api> apis) {
         String json = JSON.toJSONString(apis, new SerializerFeature[]{SerializerFeature.DisableCircularReferenceDetect});
         Map<Object,Object> paras = new HashMap<Object,Object>();
         paras.put("api", json);
         FreemarketTemplate.output(Constant.HTML_TEMPALTE,DocConfig.getValue("out.path"), paras);
        
    }

}
